package com.example.controller;

import com.example.pojo.dto.CollectDTO;
import com.example.service.DriverService;
import com.example.vo.Result;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 本文来演示
 *
 * @author 赵建云
 * @create 2023/10/12
 */
@RestController
@RequestMapping("driver")
public class DriverController {
    @Autowired
    private DriverService driverService;
    @PostMapping("already")
    public Result already(Integer page,Integer limit,Integer jsId){
        PageInfo<CollectDTO> pageInfo = driverService.findAlready(page,limit,jsId);
        return new Result(200,"已投递内容",pageInfo);
    }
    @PostMapping("total")
    public Result total(Integer jsId){
        List<CollectDTO> list = driverService.findAlreadyList(jsId);
        return new Result(200,"已投递成功的职位的条数",list.size());
    }


}
